<template>
  <el-card style="margin-bottom:20px;">
    <div slot="header" class="clearfix">
      <span>个人信息</span>
    </div>
    <div class="user-profile">
      <div class="box-center">
        <pan-thumb :image="user.avatar || ''" :height="'100px'" :width="'100px'" :hoverable="false">
          <!--          <div>{{ user.userName }}</div>-->
          <!--          {{ user.role }}-->
        </pan-thumb>
        <div class="box-center">
          <div class="user-name text-center">{{ user.username }} ({{ user.name }} )</div>
          <div class="user-role text-center text-muted">{{ user.role }}</div>
        </div>
      </div>
      <!--      <div class="text-center">-->
      <!--        <userAvatar />-->
      <!--      </div>-->
      <ul class="list-group list-group-striped">
        <li class="list-group-item">
          <svg-icon icon-class="user" />
          用户名称
          <div class="pull-right">{{ user.name }}</div>
        </li>
        <li class="list-group-item">
          <i class="el-icon-phone" />
          手机号码
          <div class="pull-right">{{ user.mobile }}</div>
        </li>
        <li class="list-group-item">
          <svg-icon icon-class="email" />
          用户邮箱
          <div class="pull-right">{{ user.email }}</div>
        </li>
        <li class="list-group-item">
          <svg-icon icon-class="email" />
          性别
          <div class="pull-right">        {{ user.gender === 'M' ? '男' : '女' }}</div>
        </li>
        <li class="list-group-item">
          <svg-icon icon-class="tree" />
          所属组织
          <div class="pull-right">{{ user.orgName }}</div>
        </li>
        <li class="list-group-item">
          <svg-icon icon-class="peoples" />
          所属角色
          <div class="pull-right">{{ roleNames }}</div>
        </li>
        <li class="list-group-item">
          <svg-icon icon-class="peoples" />
          所属岗位
          <div class="pull-right">{{ postNames }}</div>
        </li>
        <li class="list-group-item">
          <i class="el-icon-date" />
          创建日期
          <div class="pull-right">{{ user.createdTime }}</div>
        </li>
      </ul>
    </div>

    <!--    <div class="user-bio">-->
    <!--&lt;!&ndash;      <div class="user-education user-bio-section">&ndash;&gt;-->
    <!--&lt;!&ndash;        <div class="user-bio-section-header"><svg-icon icon-class="education" /><span>Education</span></div>&ndash;&gt;-->
    <!--&lt;!&ndash;        <div class="user-bio-section-body">&ndash;&gt;-->
    <!--&lt;!&ndash;          <div class="text-muted">&ndash;&gt;-->
    <!--&lt;!&ndash;            JS in Computer Science from the University of Technology&ndash;&gt;-->
    <!--&lt;!&ndash;          </div>&ndash;&gt;-->
    <!--&lt;!&ndash;        </div>&ndash;&gt;-->
    <!--&lt;!&ndash;      </div>&ndash;&gt;-->

    <!--&lt;!&ndash;      <div class="user-skills user-bio-section">&ndash;&gt;-->
    <!--&lt;!&ndash;        <div class="user-bio-section-header"><svg-icon icon-class="skill" /><span>Skills</span></div>&ndash;&gt;-->
    <!--&lt;!&ndash;        <div class="user-bio-section-body">&ndash;&gt;-->
    <!--&lt;!&ndash;          <div class="progress-item">&ndash;&gt;-->
    <!--&lt;!&ndash;            <span>Vue</span>&ndash;&gt;-->
    <!--&lt;!&ndash;            <el-progress :percentage="70" />&ndash;&gt;-->
    <!--&lt;!&ndash;          </div>&ndash;&gt;-->
    <!--&lt;!&ndash;          <div class="progress-item">&ndash;&gt;-->
    <!--&lt;!&ndash;            <span>JavaScript</span>&ndash;&gt;-->
    <!--&lt;!&ndash;            <el-progress :percentage="18" />&ndash;&gt;-->
    <!--&lt;!&ndash;          </div>&ndash;&gt;-->
    <!--&lt;!&ndash;          <div class="progress-item">&ndash;&gt;-->
    <!--&lt;!&ndash;            <span>Css</span>&ndash;&gt;-->
    <!--&lt;!&ndash;            <el-progress :percentage="12" />&ndash;&gt;-->
    <!--&lt;!&ndash;          </div>&ndash;&gt;-->
    <!--&lt;!&ndash;          <div class="progress-item">&ndash;&gt;-->
    <!--&lt;!&ndash;            <span>ESLint</span>&ndash;&gt;-->
    <!--&lt;!&ndash;            <el-progress :percentage="100" status="success" />&ndash;&gt;-->
    <!--&lt;!&ndash;          </div>&ndash;&gt;-->
    <!--&lt;!&ndash;        </div>&ndash;&gt;-->
    <!--&lt;!&ndash;      </div>&ndash;&gt;-->
    <!--    </div>-->
  </el-card>
</template>

<script>
import PanThumb from '@/components/PanThumb'

export default {
  components: { PanThumb },
  props: {
    user: {
      type: Object,
      default: () => ({
        username: '',
        name: '',
        fullName: '',
        avatar: '',
        role: '',
        orgName: '',
        postName: '',
        email: '',
        mobile: '',
        createdTime: '',
        roles: [],
        posts: [],
        roleOptions: [],
        postOptions: []
      })
    },
    roleNames: {
      type: String,
      default: ''
    },
    postNames: {
      type: String,
      default: ''
    }
  }
}
</script>

<style lang="scss" scoped>
.box-center {
  margin: 0 auto;
  display: table;
}
.list-group {
  padding-left: 0px;
  list-style: none;
}

.list-group-item {
  border-bottom: 1px solid #e7eaec;
  border-top: 1px solid #e7eaec;
  margin-bottom: -1px;
  padding: 20px 0px;
  font-size: 13px;
}
.text-muted {
  color: #777;
}

.user-profile {
  .user-name {
    font-weight: bold;
  }

  .box-center {
    padding-top: 10px;
  }

  .user-role {
    padding-top: 10px;
    font-weight: 400;
    font-size: 14px;
  }

  .box-social {
    padding-top: 30px;

    .el-table {
      border-top: 1px solid #dfe6ec;
    }
  }

  .user-follow {
    padding-top: 20px;
  }
}

.user-bio {
  margin-top: 20px;
  color: #606266;

  span {
    padding-left: 4px;
  }

  .user-bio-section {
    font-size: 14px;
    padding: 15px 0;

    .user-bio-section-header {
      border-bottom: 1px solid #dfe6ec;
      padding-bottom: 10px;
      margin-bottom: 10px;
      font-weight: bold;
    }
  }
}
</style>
